/* Global CSS Reset and Base Styles */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

#root {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #777;
}

::-webkit-scrollbar-corner {
  background: #2a2a2a;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #555 #2a2a2a;
}

/* Selection styles */
::selection {
  background-color: #007acc;
  color: #ffffff;
}

::-moz-selection {
  background-color: #007acc;
  color: #ffffff;
}

/* Focus styles */
:focus {
  outline: 2px solid #007acc;
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid #007acc;
  outline-offset: 2px;
}

/* Button reset */
button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Input reset */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Link styles */
a {
  color: #007acc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Utility classes */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-1 {
  flex: 1;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-mono {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.select-none {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.pointer-events-none {
  pointer-events: none;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-default {
  cursor: default;
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.2s ease-in-out;
}

.fade-out {
  animation: fadeOut 0.2s ease-in-out;
}

.slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.slide-out-right {
  animation: slideOutRight 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

/* Terminal specific styles */
.terminal-container {
  background-color: #000000;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.terminal-header {
  background-color: #2a2a2a;
  padding: 8px 12px;
  border-bottom: 1px solid #404040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.terminal-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
}

.terminal-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-body {
  position: relative;
  background-color: #000000;
  overflow: hidden;
}

/* Connection status indicators */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-connected {
  background-color: #4caf50;
  box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
}

.status-connecting {
  background-color: #ff9800;
  box-shadow: 0 0 4px rgba(255, 152, 0, 0.5);
  animation: pulse 1.5s infinite;
}

.status-disconnected {
  background-color: #f44336;
  box-shadow: 0 0 4px rgba(244, 67, 54, 0.5);
}

.status-error {
  background-color: #f44336;
  box-shadow: 0 0 4px rgba(244, 67, 54, 0.5);
  animation: blink 1s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0.3;
  }
}

/* Sidebar styles */
.sidebar {
  background-color: #2a2a2a;
  border-right: 1px solid #404040;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #404040;
  background-color: #333333;
}

.sidebar-content {
  padding: 8px;
}

/* Connection list styles */
.connection-item {
  padding: 12px;
  margin: 4px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: 1px solid transparent;
}

.connection-item:hover {
  background-color: #3a3a3a;
}

.connection-item.active {
  background-color: #007acc;
  border-color: #4da6ff;
}

.connection-item.active:hover {
  background-color: #005299;
}

.connection-name {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 4px;
  color: #ffffff;
}

.connection-details {
  font-size: 0.75rem;
  color: #b3b3b3;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form styles */
.form-section {
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #ffffff;
  border-bottom: 1px solid #404040;
  padding-bottom: 8px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row .form-field {
  flex: 1;
}

.form-field {
  margin-bottom: 16px;
}

.form-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #ffffff;
}

.form-field-hint {
  font-size: 0.75rem;
  color: #b3b3b3;
  margin-top: 4px;
}

/* Tab styles */
.tab-panel {
  padding: 0;
  height: 100%;
  overflow: hidden;
}

.tab-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Loading styles */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(26, 26, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top: 3px solid #007acc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error styles */
.error-message {
  background-color: #2d1b1b;
  border: 1px solid #f44336;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  color: #ffcdd2;
  font-size: 0.875rem;
}

.error-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.error-details {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Success styles */
.success-message {
  background-color: #1b2d1b;
  border: 1px solid #4caf50;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  color: #c8e6c9;
  font-size: 0.875rem;
}

/* Warning styles */
.warning-message {
  background-color: #2d2416;
  border: 1px solid #ff9800;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  color: #ffe0b2;
  font-size: 0.875rem;
}

/* Info styles */
.info-message {
  background-color: #162d2d;
  border: 1px solid #2196f3;
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  color: #bbdefb;
  font-size: 0.875rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .sidebar {
    width: 100% !important;
  }
}

/* Print styles */
@media print {
  * {
    background: white !important;
    color: black !important;
  }
  
  .sidebar,
  .terminal-controls,
  button {
    display: none !important;
  }
}